package zhuhai.tedu.parttimess.domain.vo;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.BeanUtils;
import zhuhai.tedu.parttimess.domain.Student;
import zhuhai.tedu.parttimess.domain.User;

import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.util.Date;

@ApiModel(value = "学生")
public class StudentVo {

    @ApiModelProperty(value = "ID")
    private Integer id;
    @ApiModelProperty(value = "姓名")
    private String name;  //学生名
    @ApiModelProperty(value = "产品线")
    private String productLine; //产品线
    @ApiModelProperty(value = "班级")
    private String className;  //班级
    @ApiModelProperty(value = "性别")
    private String sex;//性别
    @ApiModelProperty(value = "学习地点")
    private String studyLocation; //学习地点
    @ApiModelProperty(value = "负责项目经理")
    private String manager;//负责项目经理
    @ApiModelProperty(value = "月报日期")
    private Date monthlyDate;//月报日期
    @ApiModelProperty(value = "学费总值")
    private Double totalFee;  //学费总值
    @ApiModelProperty(value = "课期数")
    private Integer classAmount;  //课期数
    @ApiModelProperty(value = "咨询顾问")
    private String  consultant;  //咨询顾问
    @ApiModelProperty(value = "目前状态")
    private String status; //目前状态
    @ApiModelProperty(value = "QQ号")
    private Integer  qq;  //QQ号
    @ApiModelProperty(value = "电话")
    private String phone;//电话
    @ApiModelProperty(value = "班主任")
    private String  headmaster;  //班主任
    @ApiModelProperty(value = "用户id")
    private Integer  userId;  //用户id
    @ApiModelProperty(value = "用户名")
    private String  userName;  //用户名
    public StudentVo(){

    }

    public StudentVo(Student student){
        if(null!=student){
            BeanUtils.copyProperties(student,this);
            User user=student.getUser();
            if(null!=user){
                userId=user.getId();
                userName=user.getName();
            }
        }
    }


    public Student toStudent(){
        Student student=new Student();
        BeanUtils.copyProperties(this,student);
        User user=new User();
        student.setUser(user);
        if (null!=userId){
            user.setId(userId);
        }
        if(null!=userName){
            user.setName(userName);
        }
        return student;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProductLine() {
        return productLine;
    }

    public void setProductLine(String productLine) {
        this.productLine = productLine;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getStudyLocation() {
        return studyLocation;
    }

    public void setStudyLocation(String studyLocation) {
        this.studyLocation = studyLocation;
    }

    public String getManager() {
        return manager;
    }

    public void setManager(String manager) {
        this.manager = manager;
    }

    public Date getMonthlyDate() {
        return monthlyDate;
    }

    public void setMonthlyDate(Date monthlyDate) {
        this.monthlyDate = monthlyDate;
    }

    public Double getTotalFee() {
        return totalFee;
    }

    public void setTotalFee(Double totalFee) {
        this.totalFee = totalFee;
    }

    public Integer getClassAmount() {
        return classAmount;
    }

    public void setClassAmount(Integer classAmount) {
        this.classAmount = classAmount;
    }

    public String getConsultant() {
        return consultant;
    }

    public void setConsultant(String consultant) {
        this.consultant = consultant;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getQq() {
        return qq;
    }

    public void setQq(Integer qq) {
        this.qq = qq;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getHeadmaster() {
        return headmaster;
    }

    public void setHeadmaster(String headmaster) {
        this.headmaster = headmaster;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}
